<html>
<head>
  <title>Boxes</title>

  <script src="BoxesGame.js" type="text/javascript"></script>

  <script src="Point.js" type="text/javascript"></script>

  <script src="Line.js" type="text/javascript"></script>

  <script type="text/javascript">

    function start() {
      try {
        var c = document.getElementById('canvas');
        var game = new BoxesGame(c, 4);
        game.Log = log;
        game.start();
      }
      catch (e) {
        log(e);
      }
    }

    function log(message) {
      messageDiv.innerHTML += message + "<br/>"; // + messageDiv.innerHTML;
    }

    function clearLog() {
      messageDiv.innerHTML = '';
    }  
  </script>

</head>
<body onload="start();">
  <canvas id="canvas" height="500" width="500">
    There be no canvas support in your browser.
  </canvas>
  <br />
  <div id="messageDiv">
  </div>
</body>
</html>
